#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <assert.h>
char* my_strcpy(char* dest, const char* beg, size_t num)
{
	char* ret = dest;
	assert(dest != NULL);
	assert(beg != NULL);
	int flage = 0;
	while (*beg && flage < num)
	{
		*dest++ = *beg++;
		flage++;
	}
	return ret;
}
int main()
{
	char arr1[20] = { "xxxx" };
	char arr2[] = "i am big cow";
	printf("%s\n", my_strcpy(arr1, arr2, 4));
	return 0;
}